﻿<pn:PhoneApplicationPage
    x:Name="uxHomeView"
    x:Class="PillBox.Client.Views.HomeView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:pi="clr-namespace:PillBox.Interactivity;assembly=PillBox.Interactivity"
    xmlns:pn="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:im="clr-namespace:Microsoft.Expression.Interactivity.Media;assembly=Microsoft.Expression.Interactions"
    xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
    xmlns:views="clr-namespace:PillBox.Client.Views"
    xmlns:vm="clr-namespace:PillBox.Client.Framework"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480">
	<pn:PhoneApplicationPage.Resources>
		<Storyboard x:Name="AnimateIn">
            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="title" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="section1title" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="section2title" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="section3title" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="section4title" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="title" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="section1title" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="section2title" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="section3title" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="section4title" d:IsOptimized="True"/>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="sections">
				<EasingDoubleKeyFrame KeyTime="0" Value="550"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="530">
					<EasingDoubleKeyFrame.EasingFunction>
						<CubicEase EasingMode="EaseIn"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="916"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="canvas">
				<EasingDoubleKeyFrame KeyTime="0" Value="-128"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="0">
					<EasingDoubleKeyFrame.EasingFunction>
						<CubicEase EasingMode="EaseIn"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.GlobalOffsetX)" Storyboard.TargetName="canvas">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.GlobalOffsetY)" Storyboard.TargetName="canvas">
				<EasingDoubleKeyFrame KeyTime="0" Value="83"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="canvas">
				<EasingDoubleKeyFrame KeyTime="0" Value="-81"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
        <Storyboard x:Name="AnimateOut">
            <DoubleAnimation Duration="0:0:0.7" To="-340" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="title" d:IsOptimized="True">
            	<DoubleAnimation.EasingFunction>
            		<CubicEase EasingMode="EaseInOut"/>
            	</DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.7" To="-340" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="section1title" d:IsOptimized="True">
            	<DoubleAnimation.EasingFunction>
            		<CubicEase EasingMode="EaseInOut"/>
            	</DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.7" To="-340" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="section2title" d:IsOptimized="True">
            	<DoubleAnimation.EasingFunction>
            		<CubicEase EasingMode="EaseInOut"/>
            	</DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.7" To="-340" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="section3title" d:IsOptimized="True">
            	<DoubleAnimation.EasingFunction>
            		<CubicEase EasingMode="EaseInOut"/>
            	</DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.7" To="-340" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="section4title" d:IsOptimized="True">
            	<DoubleAnimation.EasingFunction>
            		<CubicEase EasingMode="EaseInOut"/>
            	</DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.7" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="title" d:IsOptimized="True">
            	<DoubleAnimation.EasingFunction>
            		<CubicEase EasingMode="EaseInOut"/>
            	</DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.7" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="section1title" d:IsOptimized="True">
            	<DoubleAnimation.EasingFunction>
            		<CubicEase EasingMode="EaseInOut"/>
            	</DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.7" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="section2title" d:IsOptimized="True">
            	<DoubleAnimation.EasingFunction>
            		<CubicEase EasingMode="EaseInOut"/>
            	</DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.7" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="section3title" d:IsOptimized="True">
            	<DoubleAnimation.EasingFunction>
            		<CubicEase EasingMode="EaseInOut"/>
            	</DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.7" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="section4title" d:IsOptimized="True">
            	<DoubleAnimation.EasingFunction>
            		<CubicEase EasingMode="EaseInOut"/>
            	</DoubleAnimation.EasingFunction>
            </DoubleAnimation>
        </Storyboard>
    </pn:PhoneApplicationPage.Resources>
    <Grid Background="{StaticResource PhoneBackgroundBrush}">
    	<VisualStateManager.VisualStateGroups>
    		<VisualStateGroup x:Name="PanoramaStates">
    			<VisualStateGroup.Transitions>
    				<VisualTransition GeneratedDuration="0:0:1">
    					<VisualTransition.GeneratedEasingFunction>
    						<CubicEase EasingMode="EaseOut"/>
    					</VisualTransition.GeneratedEasingFunction>
    				</VisualTransition>
    			</VisualStateGroup.Transitions>
    			<VisualState x:Name="PeopleState">
    				<Storyboard>
    					<DoubleAnimation Duration="0" To="20" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="sections" d:IsOptimized="True"/>
    					<DoubleAnimation Duration="0" To="11" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="title" d:IsOptimized="True"/>
    					<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rightShadow" d:IsOptimized="True"/>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="uxHomeView">
    						<DiscreteObjectKeyFrame KeyTime="0" Value="People"/>
    					</ObjectAnimationUsingKeyFrames>
    				</Storyboard>
    			</VisualState>
    			<VisualState x:Name="ScheduleState">
    				<Storyboard>
    					<DoubleAnimation Duration="0" To="-422" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="sections" d:IsOptimized="True"/>
    					<DoubleAnimation Duration="0" To="-56" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="title" d:IsOptimized="True"/>
    					<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="leftShadow" d:IsOptimized="True"/>
    					<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rightShadow" d:IsOptimized="True"/>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="uxHomeView">
    						<DiscreteObjectKeyFrame KeyTime="0" Value="Schedule"/>
    					</ObjectAnimationUsingKeyFrames>
    				</Storyboard>
    			</VisualState>
    			<VisualState x:Name="NotesState">
    				<Storyboard>
    					<DoubleAnimation Duration="0" To="-860" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="sections" d:IsOptimized="True"/>
    					<DoubleAnimation Duration="0" To="-123" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="title" d:IsOptimized="True"/>
    					<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="leftShadow" d:IsOptimized="True"/>
    					<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rightShadow" d:IsOptimized="True"/>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="uxHomeView">
    						<DiscreteObjectKeyFrame KeyTime="0" Value="Notes"/>
    					</ObjectAnimationUsingKeyFrames>
    				</Storyboard>
    			</VisualState>
    			<VisualState x:Name="MedicationState">
    				<Storyboard>
    					<DoubleAnimation Duration="0" To="-1298" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="sections" d:IsOptimized="True"/>
    					<DoubleAnimation Duration="0" To="-190" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="title" d:IsOptimized="True"/>
    					<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="leftShadow" d:IsOptimized="True"/>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag)" Storyboard.TargetName="uxHomeView">
    						<DiscreteObjectKeyFrame KeyTime="0" Value="Medication"/>
    					</ObjectAnimationUsingKeyFrames>
    				</Storyboard>
    			</VisualState>
    		</VisualStateGroup>
    	</VisualStateManager.VisualStateGroups>
    	<Canvas
            x:Name="canvas"
            Margin="0,0,-1072,0"
            Background="#00000000"
            RenderTransformOrigin="0.5,0.5">
    		<Canvas.RenderTransform>
    			<CompositeTransform/>
    		</Canvas.RenderTransform>
    		<Canvas.Projection>
    			<PlaneProjection CenterOfRotationX="0"/>
    		</Canvas.Projection>
    		<i:Interaction.Triggers>
                <pi:SwipeGestureTrigger>
                    <pi:SwipeGotoState TargetName="sections"/>
                    <pi:SwipeGesture TargetName="title" Velocity="0.15"/>
                </pi:SwipeGestureTrigger>
    			<im:StoryboardCompletedTrigger Storyboard="{StaticResource AnimateIn}">
    				<ic:GoToStateAction StateName="ScheduleState"/>
    			</im:StoryboardCompletedTrigger>
				<i:EventTrigger EventName="Loaded">
					<im:ControlStoryboardAction Storyboard="{StaticResource AnimateIn}"/>
				</i:EventTrigger>
    		</i:Interaction.Triggers>
    		<Grid
    			x:Name="title" 
    			HorizontalAlignment="Left" 
    			Width="1000" RenderTransformOrigin="0.5,0.5">
    			<Grid.Projection>
    				<PlaneProjection CenterOfRotationX="0"/>
    			</Grid.Projection>
    			<Grid.RenderTransform>
    				<CompositeTransform TranslateX="520"/>
    			</Grid.RenderTransform>
    			<TextBlock
    				Text="pillbox" 
    				FontFamily="Segoe WP N Light" 
    				FontSize="186.667" 
    				Foreground="White" 
    				Margin="0,-52,0,0" />
    		</Grid>
    		<Grid
    			x:Name="sections" 
    			HorizontalAlignment="Left" 
    			VerticalAlignment="Bottom"
    			Height="675" 
    			Width="1752"
                RenderTransformOrigin="0.5,0.5"
                Canvas.Top="125">
    			<Grid.Projection>
    				<PlaneProjection CenterOfRotationX="0"/>
    			</Grid.Projection>
    			<Grid.RenderTransform>
    				<CompositeTransform TranslateX="916"/>
    			</Grid.RenderTransform>
    			<Grid.ColumnDefinitions>
    				<ColumnDefinition Width="0.25*" />
    				<ColumnDefinition Width="0.25*" />
    				<ColumnDefinition Width="0.25*" />
    				<ColumnDefinition Width="0.25*" /> 		
    			</Grid.ColumnDefinitions>
    			<Grid.RowDefinitions>
    				<RowDefinition Height="149"/>
    				<RowDefinition />
    			</Grid.RowDefinitions>
    			<TextBlock
    				x:Name="section1title"
    				Text="people"
    				Style="{StaticResource PhoneTextTitle1Style}" 
    				VerticalAlignment="Bottom"
                    RenderTransformOrigin="0.5,0.5">
    				<TextBlock.RenderTransform>
    					<CompositeTransform/>
    				</TextBlock.RenderTransform>
    				<i:Interaction.Triggers>
    					<i:EventTrigger EventName="MouseLeftButtonDown">
    						<ic:GoToStateAction StateName="PeopleState"/>
    					</i:EventTrigger>
    				</i:Interaction.Triggers>
    			</TextBlock>
    			<TextBlock
    				x:Name="section2title"
    				Text="schedules"
    				Style="{StaticResource PhoneTextTitle1Style}" 
    				VerticalAlignment="Bottom"
    				Grid.Column="1" RenderTransformOrigin="0.5,0.5" Foreground="White">
    				<TextBlock.RenderTransform>
    					<CompositeTransform/>
    				</TextBlock.RenderTransform>
    				<i:Interaction.Triggers>
    					<i:EventTrigger EventName="MouseLeftButtonDown">
    						<ic:GoToStateAction StateName="ScheduleState"/>
    					</i:EventTrigger>
    				</i:Interaction.Triggers>		
    			</TextBlock>
    			<TextBlock
    				x:Name="section3title"
    				Text="notes"
    				Style="{StaticResource PhoneTextTitle1Style}" 
    				VerticalAlignment="Bottom"
    				Grid.Column="2" RenderTransformOrigin="0.5,0.5">
    				<TextBlock.RenderTransform>
    					<CompositeTransform/>
    				</TextBlock.RenderTransform>
    				<i:Interaction.Triggers>
    					<i:EventTrigger EventName="MouseLeftButtonDown">
    						<ic:GoToStateAction StateName="NotesState"/>
    					</i:EventTrigger>
    				</i:Interaction.Triggers>
    			</TextBlock>
    			<TextBlock
    				x:Name="section4title"
    				Text="prescriptions"
    				Style="{StaticResource PhoneTextTitle1Style}"
    				VerticalAlignment="Bottom"
    				Grid.Column="3" RenderTransformOrigin="0.5,0.5">
    				<TextBlock.RenderTransform>
    					<CompositeTransform/>
    				</TextBlock.RenderTransform>
    				<i:Interaction.Triggers>
    					<i:EventTrigger EventName="MouseLeftButtonDown">
    						<ic:GoToStateAction StateName="MedicationState"/>
    					</i:EventTrigger>
    				</i:Interaction.Triggers>
    			</TextBlock>
                <ContentControl
                    x:Name="People"
                    HorizontalContentAlignment="Stretch"
                    VerticalContentAlignment="Stretch"
                    Grid.Row="1"/>
                <ContentControl
                    x:Name="Schedule"
                    HorizontalContentAlignment="Stretch"
                    VerticalContentAlignment="Stretch"
                    Grid.Row="1"
                    Grid.Column="1"/>
                <ContentControl
                    x:Name="Notes"
                    HorizontalContentAlignment="Stretch"
                    VerticalContentAlignment="Stretch"
                    Grid.Row="1"
                    Grid.Column="2"/>
                <ContentControl
                    x:Name="Medication"
                    HorizontalContentAlignment="Stretch"
                    VerticalContentAlignment="Stretch"
                    Grid.Row="1"
                    Grid.Column="3"/>
    		</Grid>
    	</Canvas>
    	<Rectangle x:Name="leftShadow" HorizontalAlignment="Left" Width="13" StrokeThickness="0" Opacity="0">
    		<Rectangle.Fill>
    			<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
    				<GradientStop Color="Black" Offset="0"/>
    				<GradientStop Offset="1"/>
    			</LinearGradientBrush>
    		</Rectangle.Fill>
    	</Rectangle>
    	<Rectangle x:Name="rightShadow" HorizontalAlignment="Right" Width="13" StrokeThickness="0" RenderTransformOrigin="0.5,0.5" Opacity="0">
    		<Rectangle.RenderTransform>
    			<CompositeTransform ScaleX="-1"/>
    		</Rectangle.RenderTransform>
    		<Rectangle.Fill>
    			<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
    				<GradientStop Color="Black" Offset="0"/>
    				<GradientStop Offset="1"/>
    			</LinearGradientBrush>
    		</Rectangle.Fill>
    	</Rectangle>
    </Grid>
</pn:PhoneApplicationPage>